#!/bin/bash

CMAKE_FLAG=""

case "$1" in
    release)
        CMAKE_FLAG="$CMAKE_FLAG -DBUILD_TYPE:STRING=release"
        ;;
    debug)
        CMAKE_FLAG="$CMAKE_FLAG -DBUILD_TYPE:STRING=debug"
        ;;
    *)
        ;;
esac

mkdir -p ./output/ && cd ./output/ \
    && cmake ../  $CMAKE_FLAG	   \
    && make -j 8
